package com.example.movie_demo

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.hjq.permissions.OnPermission
import com.hjq.permissions.Permission
import com.hjq.permissions.XXPermissions

class MainActivity : AppCompatActivity() {

    companion object{
        @SuppressLint("StaticFieldLeak")
        lateinit var ctx: Context
        const val TAG = "PP05_TAG"
        const val USERNANE = "CS3714"
        const val URL = "https://posthere.io/"
        const val ROUTE = "18wi9r11"
        val INITIALIZE_STATUS = "intialization status"
        val MUSIC_PLAYING = "music playing"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        ctx = this

        XXPermissions.with(this)
            .permission(listOf(Permission.MANAGE_EXTERNAL_STORAGE))
            .request(object : OnPermission {
                override fun hasPermission(granted: MutableList<String>?, all: Boolean) {
                    Log.e("TAG", "hasPermission: all", )
                }

                override fun noPermission(denied: MutableList<String>?, never: Boolean) {
                    finish()
                    setResult(Activity.RESULT_OK)
                }
            })


    }

}